package com.sneaker.shower.entity.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @author Hechangjian
 * @version 1.0
 * @className SessionListDTO
 * @date 2019/09/29 15:21
 * @description
 * @program bath
 */
@Data
@ApiModel("首页消息列表返回参数")
public class SessionListDTO {
    private String sessionGuid;

    private UserDTO user;

    private String lastMessageGuid;

    @ApiModelProperty("文本：text， 图片：image， 订单：order")
    private String messageType;

    @ApiModelProperty("消息内容")
    private String content;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private LocalDateTime sendTime;

    @ApiModelProperty("消息类型，0 用户消息， 1客服消息")
    private Integer type;

    @ApiModelProperty("消息是否已读")
    private Boolean hasRead = Boolean.FALSE;
}
